package cn.bluedot.framework.dao;

import java.sql.Connection;

/**
 * 连接池内的对象
 */
public class PooledConnection {
    //里面封装的是真正的物理连接对象
    private Connection conn;

    //定义一个标识,标识它是否是繁忙的，是否被占用
    private boolean isBusy = false;


    public PooledConnection(Connection conn, boolean isBusy){
        this.conn = conn;
        this.isBusy = isBusy;
    }

    public Connection getConn() {
        return conn;
    }

    public void setConn(Connection conn) {
        this.conn = conn;
    }

    public boolean isBusy() {
        return isBusy;
    }

    public void setBusy(boolean busy) {
        isBusy = busy;
    }
    //关闭连接
    public void close(){
        this.isBusy = false;
    }

}
